Skip to content

feat(auto-merge-deps): gate auto-merge on required PR check-runs#21

Merged
fabapp2 merged 1 commit into
mainfrom
claude/romantic-elion-f07142
Jun 4, 2026
Merged

feat(auto-merge-deps): gate auto-merge on required PR check-runs#21
fabapp2 merged 1 commit into
mainfrom
claude/romantic-elion-f07142

Conversation

@fabapp2

@fabapp2 fabapp2 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a required-checks input (newline- or comma-separated) to the auto-merge-deps composite action.
  • When set, queries gh api repos/{owner}/{repo}/commits/{sha}/check-runs for the PR head SHA and requires each listed check-run to be completed + conclusion=success before calling gh pr merge --auto.
  • Missing / pending / failing checks → exit 0 with skip:check:{missing,pending,failed} and a log line naming the offending check.
  • Empty input preserves prior behaviour (enforcement falls back to caller branch protection).
  • README documents the new input + minimal caller example. Test workflow gains 7 matrix cases exercising every branch via the new checks-json test seam.

Closes #20.

Test plan

  • Local bash simulation of all 9 logic paths (success, missing, pending, failed, multiline-all-pass, multiline-one-fails, rerun-last-wins, comma-separated, empty-noop) — all pass.
  • CI auto-merge-decisions matrix passes (existing 9 + new 7 cases).
  • After merge: cut a new SHA, then bump pinned ref in promptlm-clients/.github/workflows/auto-merge-deps.yml (and other callers) passing required-checks: oss-checks / run.

🤖 Generated with Claude Code

Adds a `required-checks` input (newline- or comma-separated) to the
composite action. When set, the action queries the Checks API for the
PR head SHA and requires each listed check-run to be `completed` with
`conclusion=success` before calling `gh pr merge --auto`. Missing,
pending, or failing checks exit cleanly with
`skip:check:{missing,pending,failed}` and a log line naming the check.

Empty input preserves prior behaviour — enforcement falls back to the
caller repo's branch protection. This is defense-in-depth so the
action's "safe auto-merge" intent holds even when a repo forgets to
mark its build as required.

Closes #20.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fabapp2
fabapp2 merged commit 9c1675e into main Jun 4, 2026
19 checks passed
@fabapp2
fabapp2 deleted the claude/romantic-elion-f07142 branch June 4, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto-merge-deps: gate auto-merge on a successful PR build check

1 participant